<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%  
    request.setCharacterEncoding("utf-8") ;         // 按中文接收  
    String openid = request.getAttribute("openid").toString() ;     // 接收表单参数  
    String organids = request.getAttribute("organids").toString() ;   // 接收表单参数  
   
    
	%> 
	<head>
		<meta charset="utf-8">
		<title>体重登记</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<!--标准mui.css-->
		<link rel="stylesheet" href="sb/sbwx/css/mui.min.css">
		<!--App自定义的css-->
		<link href="http://47.93.241.8/shouba2.0/sb/icons/icon.css" rel="stylesheet" type="text/css">
		<link href="http://47.93.241.8/shouba2.0/sb/themes/insdep/easyui.css" rel="stylesheet" type="text/css">
		<link href="http://47.93.241.8/shouba2.0/sb/css/demo.css" rel="stylesheet" type="text/css" />
		<link href="http://47.93.241.8/shouba2.0/sb/themes/insdep/master.css" rel="stylesheet" type="text/css" />
		<link href="http://47.93.241.8/shouba2.0/sb/themes/insdep/easyui_animation.css" rel="stylesheet" type="text/css">
		<link href="http://47.93.241.8/shouba2.0/sb/themes/insdep/easyui_plus.css" rel="stylesheet" type="text/css">
		<link href="http://47.93.241.8/shouba2.0/sb/themes/insdep/insdep_theme_default.css" rel="stylesheet" type="text/css">
		<link href="http://47.93.241.8/shouba2.0/sb/themes/insdep/icon.css" rel="stylesheet" type="text/css">
		
		<!--标准mui.css-->
		<!-- <link rel="stylesheet" href="css/mui.min.css"> -->
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="http://47.93.241.8/shouba2.0/sb/sbwx/css/app.css" />
		<link rel="stylesheet" type="text/css" href="http://47.93.241.8/shouba2.0/sb/sbwx/pro_css/registration.css" />
		<link rel="stylesheet" type="text/css" href="http://47.93.241.8/shouba2.0/sb/sbwx/pro_css/parts.css" />
		
		<style>
			.mui-table h4,
			.mui-table h5,
			.mui-table .mui-h5,
			.mui-table .mui-h6,
			.mui-table p {
				margin-top: 0;
			}
			
			.mui-table h4 {
				line-height: 21px;
				font-weight: 500;
			}
			
			.mui-table .oa-icon {
				position: absolute;
				right: 0;
				bottom: 0;
			}
			
			.mui-table .oa-icon-star-filled {
				color: #f14e41;
			}
			
			.mui-bar {
				background: #ff954e;
			}
			
			.mui-title {
				color: #fff;
			}
			
			.mui-icon-back:before,
			.mui-icon-left-nav:before {
				color: #fff;
			}
			
			.mui-col-xs-2 {
				width: 100%;
			}
			
			.mui-table-cell p {
				font-size: 0.2em;
				text-align: left;
				margin-left: 5%;
				/*vertical-align: middle;*/
			}
			
			input[type=color],
			input[type=date],
			input[type=datetime-local],
			input[type=datetime],
			input[type=email],
			input[type=month],
			input[type=number],
			input[type=password],
			input[type=search],
			input[type=tel],
			input[type=text],
			input[type=time],
			input[type=url],
			input[type=week],
			select,
			textarea {
				width: 60%;
			}
			
			input[type=color],
			input[type=date],
			input[type=datetime-local],
			input[type=datetime],
			input[type=email],
			input[type=month],
			input[type=number],
			input[type=password],
			input[type=search],
			input[type=tel],
			input[type=text],
			input[type=time],
			input[type=url],
			input[type=week],
			select,
			textarea {
				border: none;
				background: none;
			}
			
			.mui-btn,
			button,
			input[type=button],
			input[type=reset],
			input[type=submit]{
				border-radius: 5px;
				background: #FF954E;
				border: 1px solid #FF954E;
				color: #fff;
				font-family: "微软雅黑";
			}
			.mui-table-view-cell{
				margin-top: 10px;
				padding: 11px 0;
			}
			.button{
				border-radius: 5px;
				width: 95%;
				margin-top: 15px;
				margin-bottom: 15px;
			}
			.header1{
				background: #fff;
				height: 40px;
				font-size: 14px;
				text-align: center;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<!-- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a> -->
			<h1 class="mui-title">瘦吧</h1>
		</header>
		<div class="mui-content">
				<div class="header1">
					<input type="text" id  = "cusName" style="border: 0;text-align: center;" />
				</div>
				
				
				
				<div class="cl"></div>
				<div class="allwidth">
				<span style="display: inline-block;width: 70px;">最低体重：</span>
					<input type="text" id  = "minweight" readonly = "true" style="margin: 10px;  width: 16%;" />
					<span style="display: inline-block;width: 70px;">上次体重：</span>
					<input type="text" id  = "lastweight" readonly = "true" style="margin: 10px; width: 16%;" />
				</div>
			<div class="allwidth">
			
				<div>
				<span  id="cltz" >
					 <span style="display: inline-block;width: 45px;">体重：</span>
					 <input type="text" id  = "weight" style="margin: 10px; border: 1px solid #8f8f94; width: 78%;" placeholder="请输入本次体重" />
					 <span style="display: inline-block;width: 45px;">验证码：</span>
					 <input type="text" id  = "yzm" style="margin: 10px; border: 1px solid #8f8f94; width: 78%;" placeholder="请询问店员今日验证码" />
				</span>
				</div>
				
				<button type="button" style="padding: 10px 0;" class="button"  onclick="save()">开始服务</button>
				
			</div>
		</div>
	</body>
		<script src="http://47.93.241.8/shouba2.0/sb/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="http://47.93.241.8/shouba2.0/sb/js/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="http://47.93.241.8/shouba2.0/sb/js/jquery.insdep-extend.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="http://47.93.241.8/shouba2.0/sb/js/demo.js" type="text/javascript" charset="utf-8"></script>
		<script src="http://47.93.241.8/shouba2.0/sb/js/ajax2.js" type="text/javascript" charset="utf-8"></script>
		
		<!-- start: ztree -->
		<link rel="stylesheet" type="text/css" href="http://47.93.241.8/shouba2.0/sb/plugins/ztree/css/metroStyle/metroStyle.css">
		<!-- end: ztree -->

		<!-- ztree -->
		<script type="text/javascript" src="http://47.93.241.8/shouba2.0/sb/plugins/ztree/js/jquery.ztree.core.min.js"></script>
		<script type="text/javascript" src="http://47.93.241.8/shouba2.0/sb/plugins/ztree/js/jquery.ztree.excheck.min.js"></script>
		<script type="text/javascript" src="http://47.93.241.8/shouba2.0/sb/plugins/ztree/js/jquery.ztree.exedit.min.js"></script>
		
		<!-- easy -->
		<script type="text/javascript" src="http://47.93.241.8/shouba2.0/sb/js/easy/easy.js"></script>
		
		<script type="text/javascript" src="http://47.93.241.8/shouba2.0/sb/js/template.js"></script>
		
		<script type="text/javascript" src="http://47.93.241.8/shouba2.0/sb/js/common.js"></script>
		
		<!-- eova -->
		<script type="text/javascript" src="http://47.93.241.8/shouba2.0/sb/plugins/eova/eova.js"></script>
		
		<link href="http://47.93.241.8/shouba2.0/sb/plugins/msgbox/msgbox.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="http://47.93.241.8/shouba2.0/sb/plugins/msgbox/msgbox.js"></script> 
	<script src="http://47.93.241.8/shouba2.0/sb/sbwx/js/mui.min.js"></script>
	<script>
		mui.init({
			swipeBack: true //启用右滑关闭功能
		});
		
		 $(function() {   
		       
             queryUser();
		 });

		 
			// 数据库查询下拉内容
		    function queryUser() {
			
		    	var organids = "<%=organids%>";
		    	var openid = "<%=openid%>";
		        var url='/shouba2.0/wxBinShopService/getByOpenid';
				var data={"openid":openid,"organids":organids};
				//var result = common_ajax.ajaxFunc(url, data);
				$.post(url,data,function(date){
					if(date!=null && date!=""){
						var str = date.organname+date.name;
						document.getElementById("cusName").value = str;
						document.getElementById("minweight").value = date.minweight;
						document.getElementById("lastweight").value =date.nowweight;
					}
					
				})
		       
		    };
		 
		/*保存服务
		 * 
		 */
	function  save(){
		
		var openid = "<%=openid%>";
		var organids = "<%=organids%>";
		var nowweight=document.getElementById("weight").value;
		var yzm=document.getElementById("yzm").value;
		
		if(nowweight==null||nowweight==''){
			$.alert(parent.$, "体重不能为空!");
			return false;
		}
		if(yzm==null||yzm==''){
			$.alert(parent.$, "验证码不能为空!");
			return false;
		}
		
		if(openid==null||openid==''){
			$.alert(parent.$, "请先绑定顾客信息!");
			return false;
		}
		
		var url='/shouba2.0/wxBinShopService/saveInfo';
		var data={"openid":openid,"nowweight":nowweight,"organids":organids,"yzm":yzm};
		$.post(url,data,function(date){
			if(date!=null){
				if(date!='200'){
					$.alert(parent.$, date);
					
				}else{
					$.slideMsg("开始服务", parent.$);
					document.getElementById("weight").value = "";
					
				}
				
			}
			
		})
	}
	</script>

</html>